/*
 * IJA2011, Board game "Clovece nezlob se"
 * grp108
 * Tomáš Mičiak,xmicia00
 * Andrej Martinák, xmarti51
 *
 */

package src.clovece.game;


import java.awt.Point;
import javax.help.*;
import java.net.URL;
import javax.swing.*;
import src.clovece.GameFrame;

/**
 *  Class manipulating with help
 */
public class Help {

    /**
     * Used to make help with javahelp library
     *
     * @param parent
     */
    public Help(GameFrame parent)
    {

      JHelp helpViewer = null;
      try {
	      ClassLoader cl = Help.class.getClassLoader();
	      URL url = HelpSet.findHelpSet(cl, "help.hs");
              helpViewer = new JHelp(new HelpSet(cl, url));
              helpViewer.setCurrentID("Intro");
      }
      catch (Exception e) {
	     //System.err.println("API Help Set not found");
      }


      Point p = parent.getLocation();

      JFrame frame = new JFrame();
      frame.setLocation(p.x +100, p.y +100);
      frame.setSize(700,500);
      frame.getContentPane().add(helpViewer);
      frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      frame.setVisible(true);
   }
}
